﻿/******************************************************************
** 文 件 名: BD_Contract_View.aspx.cs
** Copyright (c) 2010-2012 Honestysoft (GuangZhou) Co.,LTD
** 创 建 人: 蔡少鹏
** 创建日期: 2012-3-8 2:35:58
** 描    述: 基础资料-合同信息查看页面
** 版    本: 2.0.0.0
** 修改描述:
** 修 改 人:
** 修改日期:
******************************************************************/
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Honestysoft.BaseObject;
using Honestysoft.Baseframework.WebUI;
using Honestysoft.Financing.Model;


namespace Honestysoft.Financing.WebUI.Module.Contract
{
	public partial class BD_Contract_View : BasePage
	{	
		protected override void Page_Load(object sender, EventArgs e)
        {
			base.Page_Load(sender, e);
            if (!IsPostBack)
            {
                Bind();
            }
        }		
		/// <summary>
        /// 绑定页面
        /// </summary>
        private void Bind()
        {
           	BD_Contract obj = new BaseBusinessLogic<BD_Contract>().GetEntity(Request.QueryString["ID"]);
			if(obj == null){ return; }
			_ID = obj.ID;
			//_ProjectID = obj.ProjectID;
            _ProjectID = new Honestysoft.Financing.BusinessLogic.Project(Globals.CurrentConnStringName).GetProjectName(obj.ProjectID);
                
			_ContractCategory = Honestysoft.DictionaryHelper.DictionaryInstance.GetDictionaryText(obj.ContractCategory);
			_Code = obj.Code;
			_Name = obj.Name;
			_SignDate = obj.SignDate.HasValue ? obj.SignDate.Value.ToString("yyyy-MM-dd") : "";
            _TotalPrice = obj.TotalPrice.ToString("0.00");
			_ChangePrice = obj.ChangePrice.HasValue ? obj.ChangePrice.Value.ToString("0.00") : "";
            _Stage = obj.Stage.ToString("0.00");
			_IsZD = ScriptHelper.Image.GetBooleanImage(obj.IsZD);

            _ReserveAmount = obj.ReserveAmount.HasValue ? obj.ReserveAmount.Value.ToString("0.00") : "";
			//_Contractor = obj.Contractor;
            _Contractor = new Honestysoft.Financing.BusinessLogic.Reports(Globals.CurrentConnStringName).GetCompanyName(obj.Contractor);
            _BankAccount = obj.BankAccount;
            _BankName = obj.BankName;
            _PaymentCondition = obj.PaymentCondition;
            if (!string.IsNullOrEmpty(obj.Remark))
            {
                _Remark = obj.Remark.ToString().Replace("\n", "<br/>");
            }
        }
		
		/// <summary>
        /// 标识
        /// </summary>
		protected string _ID = "";
		/// <summary>
        /// 项目代码
        /// </summary>
		protected string _ProjectID = "";
		/// <summary>
        /// 合同类别
        /// </summary>
		protected string _ContractCategory = "";
		/// <summary>
        /// 合同编号
        /// </summary>
		protected string _Code = "";
		/// <summary>
        /// 合同名称
        /// </summary>
		protected string _Name = "";
		/// <summary>
        /// 签订日期
        /// </summary>
		protected string _SignDate = "";
		/// <summary>
        /// 合同总价
        /// </summary>
		protected string _TotalPrice = "";
		/// <summary>
        /// 变更后总价
        /// </summary>
		protected string _ChangePrice = "";
		/// <summary>
        /// 前期累计拨付资金
        /// </summary>
		protected string _Stage = "";
		/// <summary>
        /// 是否暂定金额
        /// </summary>
		protected string _IsZD = "";
		/// <summary>
        /// 包含预留金
        /// </summary>
		protected string _ReserveAmount = "";
		/// <summary>
        /// 施工单位
        /// </summary>
		protected string _Contractor = "";
		/// <summary>
        /// 备注
        /// </summary>
		protected string _Remark = "";
        /// <summary>
        /// 付款条件
        /// </summary>
        protected string _PaymentCondition = "";

        protected string _BankName = "";
        protected string _BankAccount = "";
	}
}